﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Globalization;

using System.Windows;
using System.Windows.Controls;

namespace KegManager.Converters
{
    [ValueConversion(typeof(double), typeof(double))]
    public sealed class NumberFormatConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            // Convert the number into a single decimal place
            return System.Convert.ToDouble(value).ToString(parameter as string);
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
